package com.learn.english.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.learn.english.model.dto.CourseChapterDTO;
import com.learn.english.model.entity.CourseChapter;

import java.util.List;

/**
 * 课程章节服务接口
 */
public interface ICourseChapterService{

    /**
     * 根据课程ID获取章节列表
     */
    List<CourseChapter> getChapterListByCourseId(Integer courseId);

    /**
     * 添加章节
     */
    void addChapter(CourseChapterDTO dto);

    /**
     * 更新章节
     */
    boolean updateChapter(CourseChapterDTO dto);

    /**
     * 删除章节
     */
    void deleteChapter(Long id);

    /**
     * 批量删除章节
     */
    void batchDeleteChapters(List<Long> ids);

    /**
     * 更新章节排序
     */
    void updateChapterSort(List<CourseChapterDTO> chapters);

    /**
     * 发布/取消发布章节
     */
    void publishChapter(Long id, Boolean isPublished);

    CourseChapter getById(Long id);

    List<CourseChapter> getChaptersByCourseId(Long courseId);

    boolean removeById(Long id);

    boolean removeBatchByIds(List<Long> ids);

    boolean saveChapter(CourseChapterDTO chapterDTO);
}
